import proxy from "./proxy"

export const proxyReplace = (url) => {
  if (import.meta.env.VITE_NODE_ENV === "development") return url
  for (let item of Object.keys(proxy)) {
    const regx = new RegExp(item)
    if (regx.test(url)) {
      return url.replace(regx, import.meta.env.VITE_BASE_API)
    }
  }
  return url
}
